﻿; var app = app || {};

app.dataModel = (function ($) {

    var dm = {};

    dm.loadPeople = function () {
        return $.ajax('/api/Person', {
            type: "GET",
            dataType: "json"
        });
    };

    dm.removePerson = function (data) {
        return $.ajax('/api/Person?email=' + data.email(), {
            type: "DELETE"
        });
    };

    dm.savePerson = function (data) {
        return $.ajax('/api/Person', {
            type: "POST",
            data : data
        });
    }

    return dm;

})($);
